package com.hjj.AppIO;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.stream.Stream;

public class MyApp5 {
    public static void main(String[] args) {
        String temp = "";

        String path = "F:\\IO\\aa.txt";

        try {
            FileReader fileReader = new FileReader(path);
            // 过滤流
            BufferedReader bufferedReader = new BufferedReader(fileReader, 1024 * 1024 * 10);


            StringBuffer stringBuffer = new StringBuffer();

            String str = "";

            // bufferedReader.readLine()：该方法是按照行来读取文件，如果有就返回该行的数据，如果没有就返回null，
            while ((str = bufferedReader.readLine()) != null){
                stringBuffer.append(str).append("\n");
            }

            temp = stringBuffer.toString();

            bufferedReader.close();
            fileReader.close();

        } catch (IOException  e) {
            throw new RuntimeException(e);
        }


        System.out.println(temp);
    }
}
